package org.qf.service.impl;

import org.qf.dao.SmbmsUserDao;
import org.qf.entity.SmbmsUser;
import org.qf.service.SmbmsUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service //代表业务层
public class SmbmsUserServicelmp implements SmbmsUserService {

    //调用dao
    @Autowired
    private SmbmsUserDao smbmsUserDao;

    @Override
    public SmbmsUser login(String name,String password){
        SmbmsUser smbmsUser = smbmsUserDao.showUserByName(name);
        if(smbmsUser == null){
            //代表用户名为空
            return null;
        }else {
            if (smbmsUser.getUserPassword().equals(password)) {
                return smbmsUser;
            } else {
                return null;
            }
        }
    }
}
